package cn.com.chengmandian.bike.controller;


import cn.com.chengmandian.bike.model.vo.CsPeriodInfoVo;
import cn.com.chengmandian.bike.service.IEbCsPeriodService;
import cn.com.chengmandian.core.web.pojo.AgentInfo;
import cn.com.chengmandian.core.web.pojo.AjaxResult;
import cn.com.chengmandian.core.web.utils.LocalMapUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 电单车运营-客户服务时段表 前端控制器
 * </p>
 *
 * @author AutoGenerator
 * @since 2024-11-19
 */
@Api(tags = "电单车运营-客户服务时段表")
@RestController
@RequestMapping("/cs/period")
public class EbCsPeriodController {


    @Autowired
    private IEbCsPeriodService csPeriodService;

    @ApiOperation("客户服务信息(无需登录)")
    @GetMapping("/service")
    public AjaxResult<CsPeriodInfoVo> service() {
        AgentInfo agentInfo = LocalMapUtil.getAgentInfo();
        Assert.notNull(agentInfo.getAreaId(), "缺少运营区");
        return AjaxResult.success(csPeriodService.service(agentInfo.getAreaId()));
    }
}
